﻿
Public Class MysqlColInfo
    Private colname As String
    Private coltype As MySql.Data.MySqlClient.MySqlDbType
    Private ispk As Boolean
    Private isauto As Boolean
    Public Sub New(ByVal cname As String)
        colname = cname
    End Sub
    Public Property ColumnName As String
        Get
            Return colname
        End Get
        Set(ByVal value As String)
            colname = value
        End Set
    End Property

    Public Property ColumnType As MySql.Data.MySqlClient.MySqlDbType
        Get
            Return coltype
        End Get
        Set(ByVal value As MySql.Data.MySqlClient.MySqlDbType)
            coltype = value
        End Set
    End Property

    Public Property PrimaryKey As Boolean
        Get
            Return ispk
        End Get
        Set(ByVal value As Boolean)
            ispk = value
        End Set
    End Property

    Public Property AutoIncrement As Boolean
        Get
            Return isauto
        End Get
        Set(ByVal value As Boolean)
            isauto = value
        End Set
    End Property
    Public Function compare(ByVal row As DataColumn) As Boolean
        If (Not row.ColumnName = ColumnName) Then Return False
        If (Not Type.GetTypeCode(row.DataType) = ColumnType.GetTypeCode) Then Return False
        If (Not row.AutoIncrement And AutoIncrement) Then Return False
        Return True
    End Function
End Class
